package meituan;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * @Author Jun jie Yi
 * 2022/3/19 11:04
 */
public class Demo2 {
    public static void main(String[] args) {
        //正整 n, t
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int t = sc.nextInt();
        //需要加密或者是解密的字符串，用 char 数组存储
        String next = sc.next();
        char[] strs = next.toCharArray();
        List<Character> ls = new ArrayList<>();
        //将数据加入 list 以便于操作
        for (int i = 0; i < n; i++) {
            ls.add(strs[i]);
        }
        String r = null;
        if (t == 1) {//加密操作
            r = encode1(next);
        } else if (t == 2) {//解密操作
            r = decode(next);
        }
        System.out.println(r);
    }

    //加密操作
    public static String encode(List<Character> ls) {
        //加密填入字符
        int size = ls.size();
        char[] str = new char[size];
        for (int i = 0; i < size; i++) {
            int index = ls.size() / 2;
            str[i] = ls.get(index);
            ls.remove(index);
        }
        StringBuilder r = new StringBuilder(String.valueOf(str));
        return r.reverse().toString();
    }

    public static String encode1(String str) {
        char[] chars = str.toCharArray();
        StringBuilder res = new StringBuilder();
        int mid = ((str.length() + 1) / 2) - 1;
        res.append(chars[mid]);
        int l = mid - 1;
        int r = mid + 1;
        while (l > 0 || r != str.length()) {
            if ((l + 1) < (str.length() - r)) {
                res.append(chars[r]);
                r++;
            } else {
                res.append(chars[l]);
                l--;
            }
        }
        return res.toString();
    }

    //解密操作
    public static String decode(String str) {
        StringBuilder res = new StringBuilder();
        boolean startWithLeft = true;
        for (int i = str.length() - 1; i >= 0; i--) {
            if (startWithLeft) {
                startWithLeft = !startWithLeft;
                res.append(str.charAt(i));
            } else {
                startWithLeft = !startWithLeft;
                res.insert(0, str.charAt(i));
            }
        }
        return res.toString();
    }
}
